//
//  RootViewController.m
//  EducationManagementSystem
//
//  Created by 大鼻子露珠 on 2017/1/6.
//  Copyright © 2017年 大鼻子露珠. All rights reserved.
//

#import "RootViewController.h"
#import "LogindViewController.h"
#import "LuanchViewController.h"
@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor redColor];
    
    [self makeController];
    //通知???
    [self registNotifications];
    
}


-(void)makeController{
    [self makeTabBarVcs];
    [self makeLogVc];
    [self makeLuanchVc];
}


-(void)registNotifications {
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(makeLogVc) name:@"makeLogVc" object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(makeLuanchVc) name:@"makeLuanchVc" object:nil];
}

-(void)makeTabBarVcs{
    //显示标签控制器视图
    JXTabBarViewController *vc = [[JXTabBarViewController alloc] init];
    [self addChildViewController:vc];
//    ???
    [self.view addSubview:vc.view];
    self.tabVc = vc;
}

-(void)makeLogVc{
    LoginViewController *logVc = [[LoginViewController alloc] init];
    [self addChildViewController:logVc];
    [self.view addSubview:logVc.view];
}

-(void)makeLuanchVc{
    //启动页面
    LuanchViewController *lchVc = [[LuanchViewController alloc] init];
    [self addChildViewController:lchVc];
    [self.view addSubview:lchVc.view];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
